import datetime
import time


def isdate(year,month,day): #判断输入第3个字串能否组成一个时间
    if year and month and day:
        str=year+"-"+month+"-"+day
        try:
            time.strptime(str, "%Y-%m-%d")
            return True
        except:
             return False
    else:
        return False

def thasday(date1):#将一个日期，获得它的一天开始，和结束

    start = date1.strftime("%Y-%m-%d") + " 00:00:00"
    end = date1.strftime("%Y-%m-%d") + " 23:59:59"
    starttime = datetime.datetime.strptime(start, "%Y-%m-%d %H:%M:%S")
    endtime = datetime.datetime.strptime(end, "%Y-%m-%d %H:%M:%S")
    return [starttime,endtime]


